import openpyxl
from Guanjianzi.Base import Base
from selenium import webdriver
import pytest
@pytest.fixture
def driver():
    driver = webdriver.Edge()
    yield driver
def test_a(driver):
    week_sleet = openpyxl.load_workbook('jiuxian1.xlsx')
    exal = week_sleet['Sheet1']
    Page = Base(driver)
    for i in exal.iter_rows(min_row=2,values_only=True):
        action = i[2]
        parm = {}
        if action == 'open_url':
            parm['url'] = i[4]
        elif action == 'sleep':
            parm['x'] = i[5]
        elif action in ['fill','click']:
            tupe = i[3]
            vluer = i[4]
            parm['loc']=[tupe,vluer]
            if action == 'fill':
                parm['info']=i[5]
        print(parm)
        method = getattr(Page,action)
        method(**parm)





